package cn.cvs.config;

import cn.cvs.web.filter.AuthorizationFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean filterRegist(){

        FilterRegistrationBean registration =new FilterRegistrationBean();
        registration.setFilter(new AuthorizationFilter());
        registration.setName("AuthorizationFilter");
        registration.addUrlPatterns("/user/*"); //对有main的请求限制访问
        registration.setOrder(5);

        return registration;
    }
}
